import type { GreasyForkElements } from '../../../../../../../../../types/constants/personalization/greasy_fork'
import {
  AppStyleCollections,
  PAGE_ELEMENTS,
  SUPPORTED_PLATFORMS,
} from '../../../../../../../../../types/constants'

// 测试链接：https://greasyfork.org/zh-CN/scripts/534876/delete
export class ScriptDeletePage {
  elements: GreasyForkElements = PAGE_ELEMENTS[SUPPORTED_PLATFORMS.GREASY_FORK]
  private static instance: ScriptDeletePage

  /**
   * 获取单例实例
   */
  public static getInstance(): ScriptDeletePage {
    if (!ScriptDeletePage.instance) {
      ScriptDeletePage.instance = new ScriptDeletePage()
    }
    return ScriptDeletePage.instance
  }

  init(): void {
    $('.width-constraint #script-content h3 ~ p').each(function () {
      $(this).addClass(AppStyleCollections.Alert.DANGER)
    })
  }

  getMainStyles(): string {
    return `
.width-constraint {
  #script-content {
    p {
      padding-top: 0 !important;
    }
  }
}
`
  }
}
